{% extends "layout.jinja2" %}

{% block content %}

<div class="content">
  <h1><span class="font-semi-bold">Pyramid</span> <span class="smaller">Starter project</span></h1>
  <p class="lead">Welcome to <span class="font-normal">demo_pyramid</span>, a&nbsp;Pyramid application generated&nbsp;by<br><span class="font-normal">Cookiecutter</span>.</p>
</div>

{% if errors %}
  <div class="alert alert-danger" role="alert">
    <strong>Errors:</strong>
    <ul class="list-unstyled">
        {% for err in errors %}
          <li>{{err}}</li>
        {% endfor %}
        Reason: {{ error_reason }}
    </ul>    
  </div>
{% endif %}

{% if not_auth_warn %}
  <div class="alert alert-danger" role="alert">Not authenticated</div>
{% endif %}

{% if success_slo %}
  <div class="alert alert-success" role="alert">Successfully logged out</div>
{% endif %}

{% if paint_logout %}
  {% if attributes %}
    <table class="table">
      <thead>
        <th>Name</th><th>Values</th>
      </thead>
      <tbody>
        {% for attr in attributes %}
          <tr><td>{{ attr.0 }}</td>
          <td><ul class="list-unstyled">
            {% for val in attr.1 %}
              <li>{{ val }}</li>
            {% endfor %}
          </ul></td></tr>
        {% endfor %}
      </tbody>
    </table>
  {% else %}
    <div class="alert alert-danger" role="alert">You don't have any attributes</div>
  {% endif %}
  <a href="?slo" class="btn btn-danger">Logout</a>
{% else %}
  <a href="?sso" class="btn btn-primary">Login</a> <a href="?sso2" class="btn btn-info">Login and access to attrs page</a>
{% endif %}

{% endblock %}
